-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: zero gas fee poc #29
base: basechain/develop
Are you sure you want to change the base?
Conversation
LGTM and sufficient and well-designed as a PoC
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments.
string contract_address = 1 [(gogoproto.moretags) = "yaml:\"contract_address\""]; | ||
// signatures is a list of function signatures that will have zero gas fee | ||
// when called on the specified contract_address | ||
repeated string signatures = 2 [(gogoproto.moretags) = "yaml:\"signatures\""]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using the decoded string version of the function signature?
Here are three reasons for this suggestion:
1. When updating, users must manually calculate the function signature, which can be cumbersome.
2. When retrieving a stored function signature, the result is a 4-byte value like “0xa9059cbb”. Over time, it may become difficult to remember which function this corresponds to.
3. Although the probability is very low, there is a chance that 4-byte function signatures could collide. Since Solidity compilers do not check for such collisions, this could potentially be exploited maliciously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. However, there is an inefficiency in having to calculate the signature every time if it is used frequently. It's not a huge overhead, but the inefficiency needs to be addressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dudong2 Then, How about below?
- get input as string version
- store both of string and 4bytes
- verify using 4bytes
Inefficient hashing will not be needed for verification
Closes: #XXX
Description
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)